<html> 
    <head>
        <title>Registration</title>
<?php
           require_once 'connection.php';
           session_start();
           $username = $_POST['newusername'];
           $password = $_POST['newpassword'];
           $newpassword = md5($password);
           $result = mysql_query("SELECT * from user where username = '$username'");
           $row = mysql_fetch_array($result);
           if ($row){
?>
           <meta HTTP-EQUIV='REFRESH' content='3; url=index.php'>
           </head>
           <body>Username already exist<br /></body>
<?php
           }
           else
           {
           mysql_query("INSERT INTO user (username,password) VALUES ('$username','$newpassword')");
?>
           <meta HTTP-EQUIV='REFRESH' content='3; url=../anjync-file/home.php'>
           </head>
           <body>Thank you for registration<br /></body>
<?php
           $_SESSION['username']=$username;
           $path = "../anjync-file/".$username;
           mkdir($path,0700);
           }
?>
           
</html>